#
#	$Id: Makefile.Linux,v 1.1 2004/08/05 22:52:59 solyga Exp $
#

CC=gcc
CFLAGS=-Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -I$(HDDIR) -DOS_TYPE_Linux -DOS_TYPE_STR=\"Linux\" -Dprg_name=\"$(PRG)\" -DMANUAL_NUMBER=$(MAN_NO)
LDFLAGS=-Wl,-warn-common -L$(LIBDIR)

LDLIBS =
HDDIR = ./
LIBDIR = ./

PRG = qpar
MAN_NO = 1

prefix = /usr/local
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
sbindir = ${exec_prefix}/sbin
datadir = ${prefix}/share
mandir = ${prefix}/man

DOCDIR = doc

INSTALLDIR_BIN = ${DESTDIR}${bindir}
INSTALLDIR_MAN = ${DESTDIR}${mandir}/man$(MAN_NO)


all:		header.h $(PRG) $(DOCDIR)/$(PRG).$(MAN_NO)
		size $(PRG)
		touch $@

$(DOCDIR)/$(PRG).$(MAN_NO):	mkman
		./mkman > $@

mkman.c:	header.h mkmkman $(DOCDIR)/$(PRG).man
		cat $(DOCDIR)/$(PRG).man | ./mkmkman > $@

header.h:	$(PRG).h
		ln -s $(PRG).h $@

install:	all
		install -s -m 0755 -o root -g root $(PRG) $(INSTALLDIR_BIN)
		install    -m 0644 -o root -g root $(DOCDIR)/$(PRG).$(MAN_NO) $(INSTALLDIR_MAN)
		touch $@

clean:
		find . -name "*.o" -exec rm -f {} \;
		rm -f $(PRG) $(DOCDIR)/$(PRG).$(MAN_NO) header.h mkmkman mkman* all install

distclean:	clean
		rm -f Makefile
